sgdk
joy.h
Go to the documentation of this file.
00001 
00016 #ifndef _JOY_H_
00017 #define _JOY_H_
00018 
00019 
00020 #define PORT_1          0x0000
00021 #define PORT_2          0x0001
00022 
00023 
00024 #define JOY_1           0x0000
00025 #define JOY_2           0x0001
00026 #define JOY_3           0x0002
00027 #define JOY_4           0x0003
00028 #define JOY_5           0x0004
00029 #define JOY_6           0x0005
00030 #define JOY_7           0x0006
00031 #define JOY_8           0x0007
00032 #define JOY_NUM         0x0008
00033 #define JOY_ALL         0xFFFF
00034 
00035 
00036 #define BUTTON_UP       0x0001
00037 #define BUTTON_DOWN     0x0002
00038 #define BUTTON_LEFT     0x0004
00039 #define BUTTON_RIGHT    0x0008
00040 #define BUTTON_A        0x0040
00041 #define BUTTON_B        0x0010
00042 #define BUTTON_C        0x0020
00043 #define BUTTON_START    0x0080
00044 #define BUTTON_X        0x0400
00045 #define BUTTON_Y        0x0200
00046 #define BUTTON_Z        0x0100
00047 #define BUTTON_MODE     0x0800
00048 
00049 #define BUTTON_LMB      0x0040
00050 #define BUTTON_MMB      0x0010
00051 #define BUTTON_RMB      0x0020
00052 
00053 #define BUTTON_DIR      0x000F
00054 #define BUTTON_BTN      0x0FF0
00055 #define BUTTON_ALL      0x0FFF
00056 
00057 #define JOY_TYPE_PAD3           0x00
00058 #define JOY_TYPE_PAD6           0x01
00059 #define JOY_TYPE_MOUSE          0x02
00060 #define JOY_TYPE_TRACKBALL      0x03
00061 #define JOY_TYPE_MENACER        0x04
00062 #define JOY_TYPE_JUSTIFIER      0x05
00063 #define JOY_TYPE_PHASER         0x06
00064 #define JOY_TYPE_UNKNOWN        0x0F
00065 
00066 #define PORT_TYPE_MENACER       0x00
00067 #define PORT_TYPE_JUSTIFIER     0x01
00068 #define PORT_TYPE_MOUSE         0x03
00069 #define PORT_TYPE_TEAMPLAYER    0x07
00070 #define PORT_TYPE_PAD           0x0D
00071 #define PORT_TYPE_UKNOWN        0x0F
00072 #define PORT_TYPE_EA4WAYPLAY    0x10
00073 
00074 #define JOY_SUPPORT_OFF             0x00
00075 #define JOY_SUPPORT_3BTN            0x01
00076 #define JOY_SUPPORT_6BTN            0x02
00077 #define JOY_SUPPORT_MOUSE           0x03
00078 #define JOY_SUPPORT_TRACKBALL       0x04
00079 #define JOY_SUPPORT_TEAMPLAYER      0x05
00080 #define JOY_SUPPORT_EA4WAYPLAY      0x06
00081 #define JOY_SUPPORT_MENACER         0x07
00082 #define JOY_SUPPORT_JUSTIFIER_BLUE  0x08
00083 #define JOY_SUPPORT_JUSTIFIER_BOTH  0x09
00084 #define JOY_SUPPORT_PHASER          0x0A
00085 #define JOY_SUPPORT_ANALOGJOY       0x0B
00086 #define JOY_SUPPORT_KEYBOARD        0x0C
00087 
00088 
00089 typedef void _joyEventCallback(u16 joy, u16 changed, u16 state);
00090 
00091 
00099 void JOY_init();
00100 
00118 void JOY_setEventHandler(_joyEventCallback *CB);
00150 void JOY_setSupport(u16 port, u16 support);
00151 
00178 u8 JOY_getPortType(u16 port);
00179 
00201 u8 JOY_getJoypadType(u16 joy);
00202 
00236 u16  JOY_readJoypad(u16 joy);
00237 
00260 s16  JOY_readJoypadX(u16 joy);
00261 
00284 s16  JOY_readJoypadY(u16 joy);
00285 
00290 void JOY_waitPressBtn();
00295 u16 JOY_waitPressBtnTime(u16 ms);
00330 u16 JOY_waitPress(u16 joy, u16 btn);
00368 u16 JOY_waitPressTime(u16 joy, u16 btn, u16 ms);
00369 
00377 void JOY_update();
00378 
00379 
00380 #endif // _JOY_H_
 All Classes Files Functions Variables Typedefs Enumerations Defines